package cn.wes.waudiotool.audio;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import cn.wes.waudiotool.R;
import cn.wes.waudiotool.file.FilesActivity;

public class AudioActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_file;
    private final String TAG = "AudioActivity";
    private TextView tvFile;
    private String filePath = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_audio);

        Log.i(TAG, "onCreate");

        btn_file = findViewById(R.id.btn_file);
        btn_file.setOnClickListener(this);
        tvFile = findViewById(R.id.tvAudioFile);
        Intent intent = getIntent();
        filePath = intent.getStringExtra("checked");
        tvFile.setText(filePath);
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.i(TAG, "onCreate");

    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.i(TAG, "onCreate");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onCreate");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG, "onPause");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.i(TAG, "onRestart");
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.btn_file:
                goToFileActivity();
                break;
        }
    }

    private void goToFileActivity() {
        Intent intent = new Intent(this, FilesActivity.class);
        startActivity(intent);
    }
}